<!DOCTYPE html>
<html lang="zh-CN">
<!-- name: ObWeweb author: 恐咖兵糖 mail: 0@ftls.xyz website: www.ftls.xyz address: https://gitee.com/kkbt/obweb-->

<head>
    <meta charset="UTF-8">
    <title>Obsidian Share</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
    <meta name="keywords" content="Obsidian,Docsify,kkbt">
    <meta name="description" content="Obsidian Share.">
    <meta name="viewport"
        content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <link rel="stylesheet" href="//cdn.jsdelivr.net/npm/docsify-darklight-theme@latest/dist/style.min.css"
        title="docsify-darklight-theme" type="text/css" />
    <!-- <link rel="stylesheet" href="style.css" title="docsify-darklight-theme" type="text/css" /> -->
    <style>
        .markdown-section {
            max-width: 98%;
        }
    </style>
    <link rel="apple-touch-icon" sizes="180x180" href="pwa/apple-touch-icon.png">
    <link rel="icon" type="image/png" sizes="32x32" href="pwa/favicon-32x32.png">
    <link rel="icon" type="image/png" sizes="16x16" href="pwa/favicon-16x16.png">
    <link rel="manifest" href="pwa/site.webmanifest">
    <link rel="mask-icon" href="pwa/safari-pinned-tab.svg" color="#5bbad5">
    <meta name="msapplication-TileColor" content="#da532c">
    <meta name="theme-color" content="#ffffff">
</head>

<body>
    <nav>
        <a href="#/">👑HOME</a>
    </nav>
    <div id="app">We are building somthing special for you ...</div>
    <script>
        if (typeof navigator.serviceWorker !== 'undefined') {
            navigator.serviceWorker.register('sw.js')
        }
        window.$docsify = {
            markdown: { //  由于 Docsify 嵌入 markdown 文件不会执行beforeEach，不符合预期，因此写了 renderer
                smartypants: true,
                breaks: true,
                renderer: {
                    list: function (body, order, start) { // 这段代码破坏了 侧边栏 的 css 效果
                        body = body.replace(/\[\[(.*?)\|(.*?)\]\]/g, '<a href="#/$1">$2</a>') // 匹配[[path|name]]
                            .replace(/\[\[(.*?)\]\]/g, '<a href="#/$1">$1</a>') // 匹配 [[path]]
                        return body;
                    },
                    text: function (src) {
                        return src.replace(/%% .*? %%/g, ""); // 匹配插件生成的额外文字
                    }
                }
            },
            homepage: 'HOME.md', // 主页 page 默认 README.md

            subMaxLevel: 2,
            name: 'Obsidian Share',
            plugins: [
                function (hook) { // hideSidebar: false, // 隐藏侧边 false 这个会出现一堆错误 因此写个插件实现
                    hook.init(function () {
                        console.log('Welcome to ObWeb\nDocsify version: ' + window.Docsify.version)
                        if (window.innerWidth > 750) { // 手机电脑判断，自动隐藏侧边栏docsify.js里是 600 我这有平板600不够
                            document.body.classList.toggle('close')
                        }
                    })
                },
                function (hook) {
                    hook.beforeEach(function (content) {  // 每次开始解析 Markdown 内容时调用 
                        return content.replace(/\[\[(.*?)\|(.*?)\]\]/g, '[$2]($1)') // 匹配[[path|name]]
                            .replace(/\[\[(.*?)\]\]/g, '[$1]($1)') // 匹配 [[path]]
                            .replace(/%% .*? %%/g, ""); // 匹配插件生成的额外文字
                    });
                },
                function (hook) { //加载一个页脚版权声明
                    var footer = ['<br>',
                        '<div style="float:left;width:25%;"><center><a href="#/">👑主页</a>&emsp;</center></div>',
                        '<div style="float:left;width:25%;"><center><a href="#" onclick="javascript:history.go(-1);">⬅️返回</a>&emsp;</center></div>',
                        '<div style="float:left;width:25%;"><center><a href="#" onclick="javascript:history.go(1);">➡️前进</a>&emsp;</center></div>',
                        '<div style="float:left;width:25%;"><center><a href="javascript:location.reload()">🔃刷新</a></center></div>',
                        '<hr /><footer>',
                        '<center><span><a href="https://www.ftls.xyz">恐咖兵糖</a> &copy;2022.&emsp;</span><a href="http://beian.miit.gov.cn/">黑ICP备2020006577号-1</a></center>', '</footer>'
                    ].join('');
                    hook.afterEach(function (html) { // 解析成 html 后调用。
                        return html + footer;
                    });
                }
            ],
        }
    </script>
    <script src="//cdn.jsdelivr.net/npm/docsify@4.12.2/lib/docsify.min.js"></script>
    <script src="//cdn.jsdelivr.net/npm/docsify-darklight-theme@latest/dist/index.min.js" type="text/javascript"></script>
    <!-- 下面js 非必须 -->
    <script src="//cdn.jsdelivr.net/npm/vue@2/dist/vue.min.js"></script>
    <script src="//cdn.jsdelivr.net/npm/axios@0.27.2/dist/axios.min.js"></script>
    <script src="//cdn.jsdelivr.net/npm/prismjs@1.29.0/components/prism-python.min.js"></script>
</body>

</html>